#include <iostream>
using namespace std;

class Base
{
public:
  Base()
  {
    cout << "Base构造" << endl;
  }

  ~Base()
  {
    cout << "Base析构" << endl;
  }
};

class Son : public Base
{
public:
  Son()
  {
    cout << "Son构造" << endl;
  }

  ~Son()
  {
    cout << "Son析构" << endl;
  }
};

void test01()
{
  // 继承中构造和析构顺序如下：
  // 先构造父类，后构造子类，析构的顺序与构造的顺序相反
  Son s1;
}

int main(int argc, char const *argv[])
{

  test01();

  return 0;
}